<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<title>layout后台布局 - Layui</title>
<link rel="stylesheet" href="../layui/css/layui.css">
<link rel="stylesheet" href="../css/admin.css">
</head>
<body>
<div class="layui-layout layui-layout-admin">
  <div class="layui-header">
    <div class="maxdiv">
     <div class="header">
     <h1>博客后台管理首页</h1>
     <?php
      // session_start();
     if(!isset($_SESSION['username'])){
      header("Location:login.php");
      exit();
       }else{
        ?>
         <a href="out.php" class="layui-btn ">退出</a> 
         <a href="" class="layui-btn ">欢迎你,管理员<?php echo $_SESSION['username']?></a>
        <?php
        }
        ?>
     </div> 
    </div>
  </div>
  <div class="layui-side layui-bg-black">
    <?php require "public/left.php";?>
  </div>
  <div class="layui-body">
   <div class="right_div">
    <h2>文章修改界面</h2>
    <form class="layui-form" action="./newedit.php" method="post" >
      <div class="layui-form-item">
        <label class="layui-form-label">标题</label>
        <input type="hidden" value="<?php echo $str["0"]["kid"]?>" class="kind_id">
        <div class="layui-input-block">
          <input type="text" name="title" lay-verify="title" autocomplete="off" value=<?php echo $str["0"]["title"]?> class="layui-input">
        </div>
      </div>
      <div class="layui-form-item">
        <label class="layui-form-label">作者</label>
        <div class="layui-input-inline">
          <input type="text" name="author" lay-verify="pass" value=<?php echo $str["0"]["author"]?> autocomplete="off" class="layui-input">
        </div>
        <div class="layui-form-mid layui-word-aux">请修改作者</div>
      </div>
      <div class="layui-inline">
        <label class="layui-form-label">分类选择</label>
        <div class="layui-input-inline">        
            <select name="modules" lay-verify="required" lay-search="" id="eventLevel">
         <?php foreach($str1 as $val)
          {
         ?>
            <option value="<?php echo $val["id"]?>"><?php echo $val["king"]?></option>
         <?php 
          }
         ?>
          </select>
        </div>
      </div>
        <div class="layui-form-item layui-form-text">
          <span style="height:15px;display: block"></span>
          <input type="hidden" name="id" value=<?php echo $str["0"]["id"]?>>
          <label class="layui-form-label">内容</label>
          <div class="layui-input-block">
           <textarea class="layui-textarea layui-hide" name="content" lay-verify="content" id="LAY_demo_editor">
             <?php echo htmlspecialchars_decode($str["0"]["content"])?>
          </textarea>
        </div>
      </div>
      <div class="layui-form-item">
        <div class="layui-input-block">
          <button class="layui-btn" lay-submit="" lay-filter="demo1">确认修改</button>   
        </div>
      </div>
    </form>    
   </div>
  </div>
 </div>
<script src="../layui/layui.js"></script>
<script type="text/javascript" src="../js/jquery-1.10.1.min.js"></script>
<script type="text/javascript">
$(function(){
  var kid=$(".kind_id").val();
  $("#eventLevel").val(kid);
})


</script>
<script>
layui.use(['form', 'layedit', 'laydate'], function(){
  var form = layui.form()
  ,layer = layui.layer
  ,layedit = layui.layedit
  ,laydate = layui.laydate;
  
  //创建一个编辑器
  var editIndex = layedit.build('LAY_demo_editor');
 
  

  })



</script>
</body>
</html>